package com.party.mobile.web.dto.crowdfund.output;

import com.alibaba.fastjson.annotation.JSONField;
import com.party.core.model.crowdfund.CrowdfundEvent;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * 众筹主题输出视图
 * Created by wei.li.
 *
 * @date 2018/1/16 0016
 * @time 16:09
 */
public class CrowdfundEventHomeOutput {

    //主题编号
    private String id;

    //创建者名称
    private String authorName;

    //创建者图像
    private String authorLogo;

    //隐藏众筹数据
    private Integer templateStyle;

    //创建时间
    private Date createDate;

    //报名结束时间
    private Date endTime;

    //封面图
    private String pic;

    //标题
    private String title;

    //描叙
    private String remarks;

    //是否显示在主页
    @JSONField(name = "isHome")
    private boolean isHome;

    //价格
    private Float price;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getAuthorLogo() {
        return authorLogo;
    }

    public void setAuthorLogo(String authorLogo) {
        this.authorLogo = authorLogo;
    }

    public Integer getTemplateStyle() {
        return templateStyle;
    }

    public void setTemplateStyle(Integer templateStyle) {
        this.templateStyle = templateStyle;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public boolean isHome() {
        return isHome;
    }

    public void setHome(boolean home) {
        isHome = home;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public static CrowdfundEventHomeOutput transform(CrowdfundEvent event){
        CrowdfundEventHomeOutput output = new CrowdfundEventHomeOutput();
        BeanUtils.copyProperties(event, output);
        return output;
    }
}
